#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QCoreApplication>
#include <QAction>
#include <QPoint>
#include <QMenu>
#include <QMessageBox>
#include <QAction>
#include <QMouseEvent>
#include <QKeyEvent>
#include <QContextMenuEvent>
#include <QSound>
#include <QString>
#include <QTime>
#include <QDate>
#include <QDesktopServices>
#include <QUrl>
#include <QCursor>
#include <QFile>
#include <QSysInfo>
#include <QHostInfo>
#include <QStandardPaths>
#include <QXmlStreamWriter>
#include <QXmlStreamReader>
#include <QSettings>
#include <QUuid>
#include <QDir>
#include <QStringList>
#include <QProcess>

namespace Ui {
class Widget;
}

class Widget : public QWidget
{
    Q_OBJECT

public:
    explicit Widget(QWidget *parent = 0);
    ~Widget();

    //事件
    void mouseMoveEvent(QMouseEvent *);
    void mousePressEvent(QMouseEvent *);
    void keyPressEvent(QKeyEvent *);
    void mouseDoubleClickEvent(QMouseEvent *);
    bool eventFilter(QObject *obj, QEvent *event);

    //通用
    void delay(int sec);

    //菜单
    void actionSetup();
    void menuSetup();

    //具体实现声明
    void grbLanuch();
    void greet();
    void _greet();
    void showMenu();

    //配置文件
    void ercInit();
    void ercWrite();
    void ercRead();
    void uidRead();
    void elcWrite();
    void elcRead();
    void createRif();

    //grb
    void getEmotion();

    //用户
    void meet();
    void firstMeet();
    void secondMeet();

    void userAdd();

    void exitApp();
    void exitGrb();
    void exitOpt();
    void exitQuickOpt();

    void about();
    void aboutGrb();
    void aboutQt();

    void showTime();
    void showHelp();
    void quickInvoke();
    void quickNote();
    void quickTest();

    //该功能只能用于windows，linux下编译请删除
    void viewSysVer();

    //网站访问
    void visitBaidu();
    void visitGoogle();

private:
    Ui::Widget *ui;

    //通用
    QTime time;
    QString curTime;
    QDate date;
    QString today;
    int hour;
    QDir dir;

    //位置
    QPoint winPos;
    QPoint mosPos;
    QPoint dPos;

    //本机信息
    QSysInfo::WinVersion winver;
    QString hostName;
    QString homePath;
    qint64 pid;
    QProcess p;

    //用户信息
    QString grbName;
    QString masName;
    QString masNewName;
    QString masHonor;
    QString masNewHonor;

    //UUID
    QString grbUid;
    QString masUid;
    QString rid;

    //权限
    quint32 uMode;

    //好感度(暂未实现)
    quint32 ecount;
    quint32 emotion;

    //菜单
    QMenu *mo;
    QMenu *m_user;
    QMenu *m_sys;
    QMenu *m_util;
    QMenu *m_info;
    QMenu *m_grb;
    QMenu *m_grb_note;
    QMenu *m_grb_xin;
    QMenu *m_grb_url_quick;
    QMenu *m_grb_url_com;
    QMenu *m_grb_url_spec;
    QMenu *m_dev;

    //菜单Action
    QAction *aboutAction;
    QAction *aboutGrbAction;
    QAction *aboutQtAction;
    QAction *exitAction;
    QAction *showTimeAction;
    QAction *exitAppAction;
    QAction *quickTestAction;
    QAction *quickInvokeAction;
    QAction *viewSysVerAction;
    QAction *meetAction;
    QAction *noteAction;
    QAction *helpAction;

    //网址Action
    QAction *visitBaiduAction;
    QAction *visitGoogleAction;

};

#endif // WIDGET_H
